package action;

import java.util.List;


import beans.Goods;

import com.opensymphony.xwork2.ActionSupport;

import dao.GoodsDao;

@SuppressWarnings("serial")
public class GoodsAction extends ActionSupport {

	private int terminalID;//设备ID
	private int boxNum;//箱格号
	private String phoneNum;// 手机号码
	private String orderNum;// 订单号

	private Goods goods = null;

	private List<Goods> goodsList;

	GoodsDao goodsDao = new GoodsDao();
	
	/**
	 * 获取设备剩余物品列表
	 * @return
	 */
	public String getUnTakenGoods(){
		goodsList = goodsDao.getUnTakenGoods(terminalID);
		return "list";
	}
	/**
	 * 获取设备箱格历史物品
	 * @return
	 */
	public String getHistoryGoods(){
		goodsList = goodsDao.getHistoryGoods(terminalID, boxNum);
		return "list";
	}

	/**
	 * 查询用户物品
	 * 
	 * @return
	 */
	public String queryByUserPhone() {
		goodsList = goodsDao.getByUserPhone(phoneNum);
		return "list";
	}

	/**
	 * 查询投递员物品
	 * 
	 * @return
	 */
	public String queryByCourierPhone() {
		goodsList = goodsDao.getByCourierPhone(phoneNum);
		return "list";
	}

	/**
	 * 根据订单号查询物品信息
	 * 
	 * @return
	 */
	public String queryByOrderNum() {
		goodsList = goodsDao.getByOrderNum(orderNum);
		return "list";
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public List<Goods> getGoodsList() {
		return goodsList;
	}

	public void setGoodsList(List<Goods> goodsList) {
		this.goodsList = goodsList;
	}

	public String getPhoneNum() {
		return phoneNum;
	}

	public void setPhoneNum(String phoneNum) {
		this.phoneNum = phoneNum;
	}

	public String getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(String orderNum) {
		this.orderNum = orderNum;
	}

	public int getTerminalID() {
		return terminalID;
	}

	public void setTerminalID(int terminalID) {
		this.terminalID = terminalID;
	}

	public int getBoxNum() {
		return boxNum;
	}

	public void setBoxNum(int boxNum) {
		this.boxNum = boxNum;
	}

}